//
//  HWIcon3TableviewCell.m
//  HWanGame
//
//  Created by Chendaobin on 2019/8/26.
//  Copyright © 2019年 Chendaobin. All rights reserved.
//

#import "HWIcon3TableviewCell.h"
#import "FenLeiViewController.h" // 游戏大厅
#import "HWPaiHangBangViewController.h" // 排行榜
#import "HWOpenClothingViewController.h" // 开服表

@implementation HWIcon3TableviewCell


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    [self setupUI];
    
}

- (void)setupUI {
    
    
    UIView *viewheade = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 55*CFLScaleValue+10)];
    viewheade.backgroundColor = [UIColor whiteColor];
    [self addSubview:viewheade];

    NSArray *array = @[@"home_b1",@"home_b2",@"home_b3"];
    CGFloat jiajue  = (kScreenW - 110*CFLScaleValue * 3-28)/2;
    for (int i = 0; i < array.count; i++) {
        
        UIImageView *imaview = [[UIImageView alloc]initWithFrame:CGRectMake(110*CFLScaleValue*i+jiajue*i+14, 5, 110*CFLScaleValue, 55*CFLScaleValue)];
        imaview.userInteractionEnabled = YES;
        imaview.tag = i;
        imaview.image = [UIImage imageNamed:array[i]];
        [viewheade addSubview:imaview];
        
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(imaviewtap:)];
        [imaview addGestureRecognizer:tap];
        
        
    }
    
    
    
    
    
    
    
}

#pragma  mark ------ 点击图片
- (void)imaviewtap:(UITapGestureRecognizer *)sende {
    if (sende.view.tag == 0) {
           DLog(@"点击第一个图片");
        FenLeiViewController *fenlen = [[FenLeiViewController alloc]init];
        fenlen.judgeStr = @"1";
        [[HWViewUtils getCurrentVC].navigationController pushViewController:fenlen animated:YES];
        
        
        
        
    } else if (sende.view.tag == 1) {
        
        
        HWOpenClothingViewController  *OpenClothing = [[HWOpenClothingViewController alloc]init];
        [[HWViewUtils getCurrentVC].navigationController pushViewController:OpenClothing animated:YES];
         DLog(@"点击第二个图片");
        
    } else {
        
         HWPaiHangBangViewController *panhang = [[HWPaiHangBangViewController alloc]init];
         [[HWViewUtils getCurrentVC].navigationController pushViewController:panhang animated:YES];
        
         DLog(@"点击第三个图片");
    }
    
   
    
}






- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
